Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Association display #1015

Merged
merged 19 commits into from
Oct 3, 2024
Merged

Association display #1015

merged 19 commits into from
Oct 3, 2024

Conversation

jrchudy
Copy link
Member

@jrchudy jrchudy commented Aug 27, 2024

This PR adds a BulkCreateForeignKeyObject object to ermrestJS that is attached to reference once the compute function is called to initialize the object.

I left a PR comment about prefillObject maybe being here instead of chaise and another one about composite keys.

Test cases added in this PR:

  • table has 2 FKs + 3 columns that are NOT system columns
    • both FKs together are part of the same key
  • table has 2 FKs that are NOT system columns
    • the FKs are no part of key information
  • table has 3 FKs that are NOT system columns
  • table has a composite foreign key from the association table to the main table
    • ensures this feature isn't triggered for composite FKs
  • pure and binary association table

@jrchudy jrchudy self-assigned this Aug 27, 2024
@jrchudy jrchudy requested a review from RFSH August 27, 2024 00:02
js/reference.js Outdated Show resolved Hide resolved
js/reference.js Outdated Show resolved Hide resolved
js/reference.js Outdated Show resolved Hide resolved
js/reference.js Outdated Show resolved Hide resolved
js/reference.js Outdated Show resolved Hide resolved
js/reference.js Outdated Show resolved Hide resolved
js/reference.js Outdated Show resolved Hide resolved
@jrchudy jrchudy requested a review from RFSH September 13, 2024 23:11
@jrchudy
Copy link
Member Author

jrchudy commented Sep 19, 2024

@RFSH This is ready for review now with the changes to chaise that are ready. We should discuss about the 2 comments I left in this PR about:

  • how do we make sure the foreign key is not part of a composite foreign key
  • should the prefillObject be a property of reference.bulkCreateForeignKey or stay as a state variable in chaise

js/reference.js Outdated Show resolved Hide resolved
js/reference.js Show resolved Hide resolved
js/reference.js Show resolved Hide resolved
@jrchudy jrchudy requested a review from RFSH September 26, 2024 20:22
js/column.js Outdated
/**
* Given the available tuple data, generate the uniqueId for the selected row from the table this pseudo column points to
*
* @param {*} linkedData
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a small description to this param that clarifies what this is. It's the key-value pair for the column values of the table that this pseudo column points to. I'm saying this because linkedData (Tuple.linkedData and what we're passing to .filteredRef) is not just a key-value pair of one table. It has the data for all the outbound fks.

Copy link
Member

@RFSH RFSH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think everything looks good and works as expected. I like the name that you used for the new context. Can you please add the new context to the "Context names" section of annotation doc.

You should also do make all, so it generates the new api.md and then push it.

@jrchudy jrchudy merged commit 7c354b9 into master Oct 3, 2024
1 check passed
@jrchudy jrchudy deleted the association-display branch October 3, 2024 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants